package com.hsav.kcxb.adapter.manager;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.hsav.kcxb.R;
import com.hsav.kcxb.adapter.common.AbsListManager;
import com.hsav.kcxb.adapter.common.CommonViewHolder;
import com.hsav.kcxb.bean.AttentionBean;

import java.util.List;

/**
 * Created by zhao on 17-4-29.
 */

public class FansManager extends AbsListManager {

    public FansManager(List<AttentionBean> attentionBeanList, int layoutId){
        super(attentionBeanList,layoutId);
    }

    @Override
    public void bindDataView(View convertView, Object item) {
        if(convertView==null || !(item instanceof AttentionBean)){
            return;
        }
        AttentionBean attentionBean = (AttentionBean) item;

        TextView titleTx =  CommonViewHolder.get(convertView, R.id.tv_atten_name);
        ImageView headImg = CommonViewHolder.get(convertView,R.id.iv_atten_head);
        TextView markTx= CommonViewHolder.get(convertView,R.id.tv_atten_mark);
        TextView attentionTx = CommonViewHolder.get(convertView,R.id.tv_atten_flag);

        titleTx.setText(attentionBean.getName());
        markTx.setText(attentionBean.getMark());
        if(attentionBean.isAttened()){
            attentionTx.setText("已经关注");
        }else{
            attentionTx.setText("未关注");
        }
    }
}
